<link rel="stylesheet" href="/Public/css/common/morris.css">
<style>
    .table>thead>tr>th{}
    .table>tbody>tr>td{vertical-align: middle; border:0;border-right:1px solid #ddd}
    .input-group-btn{vertical-align:top}
</style>
<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header">
                <span>{$daily_sign['title']} - 数据分析</span>
            </h3>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <ul class="nav nav-tabs" id="myTab">
                        <li class="active"><a href="javascript:;">活动数据</a></li>
                        <li><a href="/User/DailySign/statisticsUser?id={$id}">用户分析</a></li>
                    </ul>
                </div>
                <div class="panel-body">
                    <input type="hidden" name="id" value="{$id}">
                    <div class="tab-content">
                        <div class="panel-heading">
                            <h4><b>整体趋势</b></h4>
                        </div>
                        <div class="panel-heading" style="height:100px;">
                            <form class="input-group" action="/User/DailySign/statistics">
                                <input type="hidden" name="id" value="{$id}">
                                <span>访客量：{$pv_count}</span>&nbsp;&nbsp;
                                <span>访客数：{$uv_count}</span>
                                <input type="text" class="form-control" style="width:200px;float:right" id="date-picker1" name="range_date" value="{$range_date}">
                                <span class="input-group-btn">
                                    <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                                </span>
                                <!--<span class="input-group-btn">-->
                                    <!--<button class="btn btn-default" type="button" onclick="download()">导出</button>-->
                                <!--</span>-->
                            </form>
                        </div>
                        <div class="panel-body">
                            <div id="graph-line"></div>
                            <if condition="$count gt 1"><div style="float:right">时间（日）</div></if>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/Public/js/common/morris-chart/morris.js"></script>
<script src="/Public/js/common/morris-chart/raphael-min.js"></script>
<script type="text/javascript" src="/Public/js/laydatenew/laydate.js"></script>
<script>
    var data = {$list};
    var count = {$count};
    if(count >= 1){
        Morris.Line({
            element: 'graph-line',
            data: data,
            xkey: 'date',
            ykeys: ['pv', 'uv'],
            labels: ['访客量', '访客数'],
            lineColors:['red','blue'],
            parseTime: false
        });
    }

    laydate.render({
        elem: '#date-picker1',
        type: 'date',
        range: '~',
        format: 'yyyy-MM-dd',
        value: '{$range_date}'
    });

    function download(){
        var id = '<?php echo $id; ?>';
        var range_date = $('#date-picker1').val();
        window.location = '/User/DailySign/exportStatistics?id=' + id + '&range_date=' + range_date;
        return false;
    }
</script>